<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.0/css/jquery.dataTables.css">

<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" language="javascript" src="//cdn.datatables.net/1.10.0/js/jquery.dataTables.js"></script>

<script type="text/javascript" language="javascript" class="init">
jQuery.fn.dataTableExt.oApi.fnGetHiddenNodes = function ( settings )
{
    var nodes;
    var display = jQuery('tbody tr', settings.nTable);
 
    if ( jQuery.fn.dataTable.versionCheck ) {
        // DataTables 1.10
        var api = new jQuery.fn.dataTable.Api( settings );
        nodes = api.rows().nodes().toArray();
    }
    else {
        // 1.9-
        nodes = this.oApi._fnGetTrNodes( settings );
    }
 
    /* Remove nodes which are being displayed */
    for ( var i=0 ; i<display.length ; i++ ) {
        var iIndex = jQuery.inArray( display[i], nodes );
 
        if ( iIndex != -1 ) {
            nodes.splice( iIndex, 1 );
        }
    }
 
    return nodes;
};

$(document).ready(function() {
   oTable = $('#product_table').dataTable();
    
   $('form').submit(function(){
      $(oTable.fnGetHiddenNodes()).find('input:hidden').appendTo(this);
   });
} );
	</script>
<body>
<div style="font-family:Arial, Helvetica, sans-serif;" >
<h1>Product Flex Price Modify:</h1>

<form id="form1" name="form1" method="post" action="" enctype="multipart/form-data">
<table border="1" cellspacing="0" cellpadding="5">
	<tr>
		<th colspan="2" scope="col">Menu</th>
		<th><span style="color:red">Warning:If tick all price will update</span></th>
	</tr>
	<tr>
		<td><input name = "import_excel" id = "import_excel" type="file"></input></td>
		<td><input name="upload" id = "upload" type = "submit" value = "Upload"></input></td>
		<td><input type="checkbox" name = "check_box" id = "check_box"><span style="color:red">Update by RRP</span></input></td>
	</tr>
	
	

</table>
<br />
<table width="1100" border="1" cellspacing="0" cellpadding="10" style="font-size:13px;" id="product_table">
<thead> 
  <tr>
    <th scope="col">ID</th>
    <th scope="col">Barcode</th>
    <th scope="col">Barcode Description</th>
    <th scope="col">Product RRP</th>
    <th scope="col">Category ID</th>
    <th scope="col">Category Name</th>
    <th scope="col">Flex Price</th>
    <th scope="col">Review date</th>
  </tr>
 </thead> 
 <tfoot> 
  <tr>
    <th scope="col">ID</th>
    <th scope="col">Barcode</th>
    <th scope="col">Barcode Description</th>
    <th scope="col">Product RRP</th>
    <th scope="col">Category ID</th>
    <th scope="col">Category Name</th>
    <th scope="col">Flex Price</th>
    <th scope="col">Review date</th>
  </tr>
  
 </tfoot>  
 <tbody>
  <?php foreach($this->pricelist as $k => $v){?>
  <tr >
  		<td><?php echo $v['id_product']?><input type = "hidden" name = "id_product[<?php echo $k;?>]" id = "id_product[<?php echo $k;?>]" value = "<?php echo $v['id_product']?>"></input></td>
		<td><?php echo $v['code_product']?></td>
		<td><?php echo $v['title_product']?></td>
		<td align="center"><?php echo $v['price_rrp']?></td>
		<td align="center"><?php echo $v['id_category']?><input type = "hidden" name = "id_category[<?php echo $k;?>]" id = "id_category[<?php echo $k;?>]" value = "<?php echo $v['id_category']?>"></input></td>
		<td align="center"><?php echo $v['category_name']?></td>
		<td align="center"><?php echo $v['flex_price']?></td>
		<td align="center"><?php echo $v['review_date']?>&nbsp;&nbsp;&nbsp;<input type = 'checkbox' name = 'checkbox[<?php echo $k;?>]' id = 'checkbox[<?php echo $k;?>]'></input></td>
		
  </tr>
  <?php }?>
  </tbody>
  
</table>
<br />
<br />


<input type="submit" name="export_excel" id="export_excel" value="Export All" />
<input type="submit" name="export_select_excel" id="export_select_excel" value="Export Select" />
<br />
</form>
</div>
</body>
</html>
